package com.zhiyou100.service.impl;

import com.zhiyou100.entity.House;
import com.zhiyou100.mapper.HouseMapper;
import com.zhiyou100.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 房屋服务实现类
 *
 * @author yang
 * @version 1.0.0
 * @date 2020-08-28 15:26
 */
@Service
public class HouseImpl implements HouseService {
    private HouseMapper houseMapper;

    @Autowired
    public void setHouseMapper(HouseMapper houseMapper) {
        this.houseMapper = houseMapper;
    }


    @Override
    public List<House> listHouse() {
        return houseMapper.listHouses();
    }

    @Override
    public House selectOneByHid(Integer hid) {
        return houseMapper.selectOneByHid(hid);
    }

    @Override
    public void updateOneHouse(House house) {
        houseMapper.updateOneHouse(house);
    }

    @Override
    public void deleteOneByHid(Integer hid) {
        houseMapper.deleteOneByHid(hid);
    }

    @Override
    public void insertOne(House house) {
        houseMapper.insertOne(house);
    }
}
